package com.sh.data.engine.repository.dao.dataasset.entity;

import lombok.Data;

import java.util.Objects;


@Data
public class TblPropWrapper {

    private Long projectId;
    private String schema;
    private String tableName;
    private Integer rowState;
    private Long id;
    private Long dataSecretId;

    public TblPropWrapper(Long id, Long projectId, String schema, String tableName, Integer rowState, Long dataSecretId) {
        this.id = id;
        this.projectId = projectId;
        this.schema = schema;
        this.tableName = tableName;
        this.rowState = rowState;
        this.dataSecretId = dataSecretId;
    }

    // Implement equals() and hashCode() based on the four fields

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TblPropWrapper that = (TblPropWrapper) o;
        return Objects.equals(projectId, that.projectId) &&
            Objects.equals(schema, that.schema) &&
            Objects.equals(tableName, that.tableName) &&
            Objects.equals(rowState, that.rowState);
    }

    @Override
    public int hashCode() {
        return Objects.hash(projectId, schema, tableName, rowState);
    }
}

